<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<!--声明文档兼容模式，表示使用IE浏览器的最新模式-->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!--设置视口的宽度(值为设备的理想宽度)，页面初始缩放值<理想宽度/可见宽度>-->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
	<title>图书在线首页</title>

	<!-- 引入Bootstrap核心样式文件 -->
	<link href="${pageContext.request.contextPath}/static/front/css/bootstrap.css" rel="stylesheet">
	<!-- 引入jQuery核心js文件 -->
	<script src="${pageContext.request.contextPath}/static/front/js/jquery-1.11.3.min.js"></script>
	<!-- 引入BootStrap核心js文件 -->
	<script src="${pageContext.request.contextPath}/static/front/js/bootstrap.min.js"></script>

	<script src="${pageContext.request.contextPath}/static/back/lib/layui/layui.js" charset="utf-8"></script>
	<link href="${pageContext.request.contextPath}/static/back/lib/layui/css/layui.css" rel="stylesheet">
		
		<style>
			.table img{
				height: 80px;
			}
			.table td{
				 vertical-align:middle !important;
			}
		</style>
	</head>

	<body>
	<!-- 头部页面 -->
	<jsp:include page="header.jsp"/>

	<!-- 主体部分 -->
			<div class="container">
				<%--<!-- 广告 -->
				<div class="row">
					<div class="hidden-md hidden-sm hidden-xs " style="padding-left: 14px; ">
						<img src="./img/ad.jpg " style="width: 99%; "/>
					</div>
				</div>--%>
				<!--页头-->
				<div class="page-header">
					<h1>我的订单 <small>您留下的足迹</small></h1>
				</div>
				<!--订单信息-->
				<table class="table">
					<thead>
						<tr class="active">
							<th>图片</th>
							<th>书名</th>
							<th>作者</th>
							<th>出版社</th>
							<th>单价</th>
							<th>数量</th>
							<th>小计</th>
						</tr>
					</thead>
					<tbody>
					<c:forEach items="${orderNum}" var="orderNumber" varStatus="status">
						<tr>
							<td colspan="7">订单编号:${orderNumber}</td>
						</tr>

						<c:forEach items="${orderInfo.get(orderNumber)}" var="order">
							<tr class="warning">
								<td><img src="${order.img}"></td>
								<td>${order.bookName}</td>
								<td>${order.author}</td>
								<td>${order.publisher}</td>
								<td>&yen; <span class="price">${order.price}</span> </td>
								<td>${order.numb}</td>
								<td>&yen; <span class="price">${order.total}</span> </td>
							</tr>
						</c:forEach>
						<%
							Date date = new Date();
							SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ss HH:mm:ss");
							String format = sdf.format(date);
							request.setAttribute("date", date);
						%>
						<tr class="success">
							<td colspan="6" align="right">下单时间: <span><fmt:formatDate value="${orderInfo.get(orderNumber).get(0).orderTime}" pattern="yyyy-MM-dd HH:mm:ss" /></span> </td>
							<td align="right">订单总价:&yen; <span class="price">${totalPrice.get(orderNumber)}</span></td>
						</tr>
					</c:forEach>
					</tbody>
				</table>
			</div>
		<!--页脚-->
		<%--<div class="container" style="margin-top: 10px;">
			<div class="row">
				<div class="hidden-md hidden-sm hidden-xs " style="padding-left: 14px;">
					<img src="./img/footer.jpg" style="width: 98%;"/>
				</div>
			</div>
		</div>--%>
		<hr />
		
		<!--友情链接和版权信息-->
		<div class="container" style="margin-top: 10px;">
			<div class="row">
				<div class="" align="center">
					<ul class="list-inline">
						<li><a>关于我们</a></li>
						<li><a>联系我们</a></li>
						<li><a>招贤纳士</a></li>
						<li><a>法律声明</a></li>
						<li><a>友情链接</a></li>
						<li><a>支付方式</a></li>
						<li><a>配送方式</a></li>
						<li><a>服务声明</a></li>
						<li><a>广告声明</a></li>
					</ul>
				</div>
				<div style="text-align: center;margin-top: 5px;margin-bottom:20px;">
					Copyright &copy; 2003-2017 书城 版权所有
				</div>
			</div>
		</div>
		
	</body>
	<script type="text/javascript">
		//删除背包项
		function delBookFromBag(bid){
			if (confirm("你真的要抛弃我吗?")) {
				location.href="./bag?method=delBookFromBag&bid="+bid;
			}
		}
		//清空背包
		function clearBag(){
			if (confirm("你就不要我们了吗?")) {
				location.href="./bag?method=clearBag";
			}
		}
	</script>
</html>